package jhlee42;

import java.io.ObjectInputStream.GetField;


public class J15Extends {
	
	public static void main(String[] args) {
		String name;
		
		J15SungHukV2 sj = new J15SungHukV2();
		sj.setName("전지현");
		sj.setKor(90);
		sj.setEng(70);
		sj.setMat(87);
		sj.setSci(85);
		sj.setArt(100);
		
		
		System.out.println(sj.getTot());
		
	}
	
	
	

}









class J15SungHukV1 {
	private String name;
	private int kor;
	private int eng;
	private int mat;
	
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getKor() {
		return kor;
	}
	public void setKor(int kor) {
		this.kor = kor;
	}
	public int getEng() {
		return eng;
	}
	public void setEng(int eng) {
		this.eng = eng;
	}
	public int getMat() {
		return mat;
	}
	public void setMat(int mat) {
		this.mat = mat;
	}
	

	public int getTot(){	
		return kor+eng+mat;
	}
}
class J15SungHukV2 extends J15SungHukV1{
	private int sci;
	private int art;
	
	
	public int getSci() {
		return sci;
	}
	public void setSci(int sci) {
		this.sci = sci;
	}
	public int getArt() {
		return art;
	}
	public void setArt(int art) {
		this.art = art;
		System.out.println(art);
	}
	
@Override
	public int getTot() {
	// TODO Auto-generated method stub
	
	return super.getTot()+sci+art;
	}




	
}

class Search4Super extends Object{
	
}











/*** 상속을 사용하지 않은 경우***/
class J15SungHukV1b{
	private String name;
	private int kor;
	private int eng;
	private int mat;
	private int sci;
	private int art;
}


